package com.atguigu.gmall.web.controller;

import com.atguigu.gmall.common.result.Result;
import org.springframework.web.bind.annotation.*;

/**
 * @author tangsy
 * @Description TODO
 * @date 2022/12/11 12:33
 * @Version 1.0
 */
@RestController
public class HelloController {

    @GetMapping("/div")
    public Result div(@RequestParam("num") Long num){
        long i = 10/num;
        return Result.ok(i);
    }

//    @ExceptionHandler({Exception.class})
//    public Result handleException(Exception e){
//        Result<Object> fail = Result.fail();
//        fail.setMessage(e.getMessage());
//        return fail;
//    }
}
